// import request from '@/utils/request/index.js'; // 封装的request.js文件的位置
import request from './utils.js'; // 封装的request.js文件的位置
 
// 获取banner 
export const getBaseInfo = (params) => {
	return request({
		url: '/index/banners',
		method: 'get',
		data:params
	})
}

// 获取首页banner 
export const getCard = (params) => {
	return request({
		url: '/index/category',
		method: 'get',
		data:params
	})
}
// 获取商品列表
export const goodsList = (params) => {
	return request({
		url: '/goods/items',
		method: 'get',
		data:params
	})
}


// 获取验证码
export const captchaSms = (params) => {
	return request({
		url: '/captchaSms',
		method: 'get',
		data:params
	})
}

// 登陆
export const loginApp = (params)=>{
	return request({
		url:'/auth/app',
		method:'post',
		data:params
	})
}
// 个人信息
export const loginGetInfo = ()=>{
	return request({
		url:'/auth/getInfo',
		method:'get',
	})
}


export const logout = (params)=>{
	return request({
		url:'/auth/logout',
		method:'get',
		data:params
	})
}

// 获取产品
export const goodsbyitem = (params)=>{
	return request({
		url:'/goods/by-item',
		method:'get',
		data:params
	})
}

// 商品详情 直接拼接id到接口后面
export const goodsOrder = (params)=>{
	return request({
		url: "/goods/" + params.id || 0,
		method:'get',
	})
}
// 创建订单
export const CreateOrder = (params)=>{
	return request({
		url: "/order/" + params,
		method:'get',
	})
}